package test;
  
  /**
   * Enumerates all   ICE   statuses for both   ICE   request and   ICE   project.
   * 
   * @author jiyjiang
   * 
   */
  public enum IceStatus {
      // The QUEUED(null) is manually added one which is not imported from ICE.
      INACTIVE(0), RUNNING(10), COMPLETED(20), SKIPPED(30), CANCELED(40), STOP(50), SHUTDOWN(
              60), SUCCESS(70), COMPLETE_WARNING(71), FAILED(80), QUEUED1(90), QUEUED2(
              91), QUEUED3(92), QUEUED4(93), QUEUED5(94), QUEUED6(95), DEPLOYING(
              100), DORMANT(101), DELETED(102), ACTIVE(110), DISABLED(120), HD_TICKET_ASSIGNED(
              121), CREATING(130), LOCKED(131), EDITTING(132), ERROR1(140), ERROR2(
              141), ERROR3(142), ERROR4(143), WARNING1(150), WARNING2(151), WARNING3(
              152), UNKNOWN(160), SUBMITTED(170), INPROGESS(171), CLOSED(172), UNDEFINED(
              null), QUEUED(null);
  
      private Integer value;
  
      private IceStatus(Integer value) {
          this.value = value;
      }
  
      public static IceStatus getEnum(Integer value) {
          for (IceStatus type : IceStatus.values()) {
              if (type.getValue() != null && type.getValue().equals(value)) {
                  return type;
              }
          }
          return UNDEFINED;
      }
  
      public Integer getValue() {
          return this.value;
      }
  
      @Override
      public String toString() {
          return String.valueOf(this.name());
      }
  
  }